package com.tarena.lbs.activity.dao.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.activity.api.pojo.ActivityDto;
import com.tarena.lbs.activity.pojo.po.ActivityPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ActivityMapper extends BaseMapper<ActivityPO> {
    @Select("SELECT COUNT(*) FROM activity WHERE id=#{activityId}")
    Integer activityVisible(Integer activityId);
    @Select("SELECT COUNT(*) FROM activity WHERE ")
    int activityTarget(Integer userId);
    @Select("SELECT " +
            "id, activity_name, status, enable_status, activity_type, channel_type, " +
            "start_date, end_date, describes,img_ids, shop_ids, target_customer, " +
            "activity_target, delivery_channel,reward_type,reward_coupon_id, " +
            "share_profile, share_url, activity_json,marketing_type,business_id, " +
            "create_at, update_at " +
            "FROM activity WHERE id = #{activityId}")
    ActivityDto getActivityDto(Integer activityId);
}
